<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<link href="${ctx}/resources/css/bootstrap/css/bootstrap.css" rel="stylesheet" />
<link href="${ctx}/resources/css/bootstrap/css/metro.css" rel="stylesheet" />
<link href="${ctx}/resources/css/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link href="${ctx}/resources/css/bootstrap/css/font-awesome.css" rel="stylesheet" />
<link href="${ctx}/resources/css/bootstrap/css/style.css" rel="stylesheet">
<link href="${ctx}/resources/css/bootstrap/css/style_responsive.css" rel="stylesheet">
<link href="${ctx}/resources/css/bootstrap/css/style_light.css" rel="stylesheet">
<link href="${ctx}/resources/css/bootstrap/css/DT_bootstrap.css" rel="stylesheet">
<link href="${ctx }/resources/css/components.css" type="text/css" rel="stylesheet" />
<link href="${ctx}/resources/css/bootstrap/css/style_light_inline.css" rel="stylesheet">
<link href="${ctx}/resources/css/datepicker.css" rel="stylesheet">
<style type="text/css">
@media ( max-width : 767px) {
	[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]
		{
		width: 49%;
		float: left;
		margin-right: 7px;
	}
}
</style>
<title>欢迎</title>
</head>
<body>
	<div class="container-fluid">
		<div class="row-fluid">
		<form action="${ctx }/cashflow/insert.jhtml" class="form-horizontal">
		<div class="control-group">
			<label class="control-label">银行名称：</label>
				<div class="controls">
					<select	name="bankId" class="span4 m-wrap" >
							<c:forEach var="bank" items="${banks }">
								<option value="${bank.id }" >${bank.bankName }</option>
							</c:forEach>
					</select>
					<span class="help-inline"></span>
				</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">交易日期：</label>
				<div class="controls">
					<input type="text" name="inDate" id="dpd1" data-date-format="yyyy-mm-dd" readonly="readonly" class="m-wrap small">
					<span class="help-inline"></span>
				</div>
			
		</div>
		<div class="control-group">
			<label class="control-label">借方金额：</label>
				<div class="controls">
					<input class="span4 m-wrap" type="text" name="debit" />
					<span class="help-inline"></span>
				</div>
		</div>
		<div class="control-group">
			<label class="control-label">贷方金额：</label>
				<div class="controls">
					<input class="span4 m-wrap" type="text" name="creditor"  />
					<span class="help-inline"></span>
				</div>
		</div>
		<div class="control-group">
			<label class="control-label">摘要：</label>
				<div class="controls">
					<input class="span4 m-wrap" type="text" name="summary" />
					<span class="help-inline"></span>
				</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注：</label>
				<div class="controls">
					<textarea class="span4 m-wrap" type="text" name="remarks" rows="4" ></textarea>
				</div>
		</div>
		<div class="form-actions">
			<input type="submit" value="保存" class="btn blue" /> 
			<a href="${ctx }/bank/list.jhtml" class="btn">返回</a>
		</div>
		</div>
		</form>
	</div>
</body>
<script type="text/javascript" src="${ctx }/resources/js/jquery.js"></script>
<script type="text/javascript" src="${ctx }/resources/js/jquery.pagination.js"></script>
<script type="text/javascript" src="${ctx }/resources/js/manager.js"></script>
<script type="text/javascript" src="${ctx }/resources/js/manager.circle.js"></script>
<script type="text/javascript" src="${ctx }/resources/css/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${ctx }/resources/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="${ctx }/resources/js/bootstrap-datepicker.zh-CN.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	initData(1);
	jQuery('#sample_1 .group-checkable').change(function () {
        var set = jQuery(this).attr("data-set");
        var checked = jQuery(this).is(":checked");
        jQuery(set).each(function () {
            if (checked) {
                $(this).attr("checked", true);
            } else {
                $(this).attr("checked", false);
            }
        });
    });
	
	checkin = $('#dpd1').datepicker({
		language: 'zh-CN' 
	}).on('changeDate', function(ev) {
		var newDate = new Date(ev.date)
		newDate.setDate(newDate.getDate() + 1);
		checkout.setStartDate(newDate);
	  	checkin.hide();
	  	$('#dpd2')[0].focus();
	}).data('datepicker');
	
	checkout = $('#dpd2').datepicker({
		language: 'zh-CN'
	}).on('changeDate', function(ev) {
		var newDate = new Date(ev.date)
		newDate.setDate(newDate.getDate() - 1);
		checkin.setEndDate(newDate);
		checkout.hide();
	}).data('datepicker');
});
function goSearch(){
	if($('#dpd2').val()!='' && $('#dpd1').val()==''){
		alert("请选择起始时间");
		$('#dpd1')[0].focus();
	}else if($('#dpd2').val()!='' && $('#dpd1').val()!=''){
		if(checkin.date.valueOf()>checkout.date.valueOf()){
			alert("起始时间必须小于结束时间");
			var newDate = new Date(checkin.date)
		    newDate.setDate(newDate.getDate() + 1);
		    checkout.setStartDate(newDate);
		    $('#dpd2')[0].focus();
		}else{
			$("#Pagination").attr("url", "searchComment");
			initData(1);
		}
	}else{
		$("#Pagination").attr("url", "searchComment");
		initData(1);
	}
}
function goReset(){
	$('#dpd1').val("");
	$('#dpd2').val("");
	$('#type').val("");
	$('#user').val("");
	$('#comment').val("");
}
</script>
<script type="text/javascript">
	var forword = function(obj) {
		if (obj == 1) {
			var $a = $(window.parent.document)
					.find(
							".page-sidebar > ul > li > ul > li > a[href$='applyArticle']");
			$a.get(0).click();
			var str = $a.parent().parent().parent().find("a").find("span")
					.text();
			text(str);
		} else if (obj == 2) {
			var $a = $(window.parent.document).find(
					".page-sidebar > ul > li > ul > li > a[href$='exp']");
			$a.get(0).click();
			var str = $a.parent().parent().parent().find("a").find("span")
					.text();
			text(str);
		} else if (obj == 3) {
			var $a = $(window.parent.document)
					.find(
							".page-sidebar > ul > li > ul > li > a[href$='managetSubject']");
			$a.get(0).click();
			var str = $a.parent().parent().parent().find("a").find("span")
					.text();
			text(str);
		} else if (obj == 4) {
			var $a = $(window.parent.document)
					.find(
							".page-sidebar > ul > li > ul > li > a[href$='articleRecycle']");
			$a.get(0).click();
			var str = $a.parent().parent().parent().find("a").find("span")
					.text();
			text(str);
		}
	};
	var text = function(obj) {
		$(window.parent.document).find(".page-sidebar > ul > li").removeClass(
				'active');
		$(window.parent.document).find(
				".page-sidebar > ul > li > a > span[class='title']").each(
				function(i) {
					var text = $(this).text();
					if (text == obj) {
						$(this).parent().parent().addClass('open active');
						$(this).after('<span class="selected"></span>');
					}
				});
	};
</script>
</html>